Process for reliably detecting the passage of a target object using a photoelectric control unit employing pseudo-random jitter factor pulses

ABSTRACT

A target acquisition system for a photoelectric control unit which helps avoid interference problems due to optical and electrical noise. The system provides for the interpulse interval between light pulses transmitted by the photoelectric control unit to be varied in accordance with pseudo-random jitter factors during the target acquisition process. Noise which may be on frequency with the normal repetition rate of the photoelectric control unit is then eliminated from the detection process pursuant to synchronous detection procedures.

BACKGROUND OF THE INVENTION

The present invention relates to photoelectric detectors and moreparticularly to photoelectric control units which periodically transmitlight pulses and synchronously detect return pulses.

In the past photoelectric control units have been manufactured in arange of models each of which is suitable for a particular type ofapplication environment. Furthermore, photoelectric control units havenot been designed to provide the operator with much in the way of usefulinformation about the unit's current settings or the conditions underwhich it is operating. Consequently, photoelectric control units havenot had much flexibility for being used in different types ofapplications and have not been able to provide much information of thetype the operator might, for example, use to align the unit. While somephotoelectric control units have been designed to operate undermicroprocessor control these units have nevertheless not been designedto be especially user friendly or to offer the operator a wide range ofoperational settings suitable for different applications. Furthermore,most photoelectric control units have been susceptible to giving falsesignals due to electrical and optical noise occurring at the samefrequency as the pulse repetition rate of the control unit itself. Suchnoise may be due to other photoelectric control units in the vicinity orsimply due to other machinery having comparable operating frequencies.Nevertheless, when the noise is on frequency with the pulse repetitionrate, ordinary pulse counting and synchronous detection techniques arenot able to eliminate the noise problem. Additionally, most traditionalphotoelectric control units have not provided accurate measures ofoperating margin or reliable indications of overall operationalstability. Operating margin has ordinarily been difficult to determineon account of the narrow voltage ranges over which most photoelectriccontrol units operate and the difficulties with amplifier saturationwhich occur when such voltage ranges are exceeded. Satisfactory systemshave not been developed for allowing a photoelectric control unit todetermine its own operating margin in an accurate fashion over a broadrange. Furthermore, even given measures of operating margin, theoperational stability of a photoelectric control unit has been difficultto determine. Photoelectric control units can be affected by high noiselevels in their operating environment which can degrade operationalstability despite satisfactory levels of operating margin.

It is therefore an object of the present invention to provide aphotoelectric control unit having a user friendly operator interfacewhich allows for operator control over a wide range of operationalsettings in a convenient and understandable fashion so that the unit canbe adapted for use in a large number of different applications.

It is another object of the present invention to provide a photoelectriccontrol unit having a target acquisition system which is immune toelectrical and optical noise occurring on frequency with the repetitionrate of the photoelectric control unit itself.

It is a further object of the present invention to provide aphotoelectric control unit which is capable of accurately measuring itsown operating margin over a broad range of signal levels and providing areliable indication of its operational stability as a function ofoperating margin and noise.

It is yet another object of the present invention to provide aphotoelectric control unit in which the pulse repetition rate andoperating range of the unit may be selected by the operator at theoperating site through the use of a user friendly interface.

It is yet a further object of the present invention to provide aphotoelectric control unit which is flexible in Operation, providesuseful information feedback to its operator, is otherwise reliable inoperation and can be produced at a reasonable cost.

SUMMARY OF THE INVENTION

The present invention constitutes a photoelectric control unit adaptedfor periodically transmitting light pulses and synchronously detectingreturn pulses having a special system architecture including variablegain modules for determining operating margin, an operator interfacehaving multiple functions for enabling operator control over the unitselectronic system, a target acquisition system having special pulsetiming features for reliably acquiring target objects despite onfrequency background interference and a system for providing anindication of the operational stability of the unit as a function ofboth operating margin and noise.

The system architecture includes two signal channels each of whichreceives and amplifies the output from the system photodetector andincludes a comparator for separately comparing the signal levels on bothchannels with a common reference level. However, the second signalchannel includes a variable gain module which allows the gain on thischannel to be adjusted to assume any of a number of different values.Operating margin is determined by adjusting the gain on the secondsignal channel until the comparator installed on this channel switchesstate and comparing the gain level at which this occurs with the gainlevel at which the first signal channel is operating. In the preferredembodiment, a variable gain module in also installed in the signal pathleading from the photodetector to both signal channels for decreasing orthrottling down the main gain level and increasing the range over whichoperating margins can be determined. Further, the preferred embodimentincludes a system for automatically setting system sensitivity foroptimum performance using measures of operating margin under backgroundand target conditions.

The operator interface includes a plurality of display icons each ofwhich corresponds to one or more control functions. These icons aredisplayed in conjunction with the selection and operation of the controlfunctions. The interface also includes a numerical display fordisplaying numerical values in conjunction with icons and for assistingin the selection of control parameters. Furthermore, in the preferredembodiment, the numerical display is operative for displaying operatingmargin as an aide in mechanical alignment of the photoelectrical controlunit. Additionally, the operator interface allows the user to select oneof a number of light pulse repetition rates and thereby automaticallyadjust the speed and conversely the range of the unit in accordance withthe requirements of its operating environment.

In order to help overcome background noise problems light pulses whichare transmitted during the target acquisition process are subject topseudo-random jitter factors. These jitter factors change the interpulsetiming intervals between selected light pulses. By varying the timingbetween pulses immunity is provided to electrical and optical noisewhich may be on frequency with the normal pulse repetition rate. Thejitter technique may be applied to various algorithms in which differentpatterns of sequential pulse reception constitute criteria for targetdetection. For example, if four consecutive return pulses must bereceived to indicate the presence of a target, after the first returnpulse is detected the next (i.e. second, third and fourth) light pulsesto be transmitted are delayed by pseudo-random type factors in order toavoid noise occurring at the normal pulse repetition rate frequencypursuant to the synchronous detection process.

The operational stability of the photoelectric control unit isdetermined by measuring photoelectric operating margin and measuringbackground noise and generating an operational stability figure as afunction of both of these quantities. In the preferred embodiment,operating margin is generated using the dual channel system architectureand noise is measured by counting the noise pulses occurring duringinterpulse periods. Stability figures are determined in accordance withfuzzy logic membership functions of operating margin and backgroundnoise and fuzzy logic rules relating stability to photoelectricoperating margin and background noise. This fuzzy logic technique allowsoperational stability figures to reflect empirical experience in orderto thereby provide a better indication of stability conditions inaccordance with real world experience.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 provides an elevated prospective view of a photoelectric controlunit showing an operator interface on the top surface of the unit.

FIG. 2 provides a block diagram illustrating the operation of aphotoelectric control unit in a retroreflective mode.

FIG. 3 provides a plan view of the operator interface of the presentinvention for use in conjunction with a photoelectric control unit.

FIG. 4 provides a block diagram of an electronic system for use in aphotoelectric control unit in accordance with the principles of thepresent invention.

FIG. 5 provides a pair of graphs illustrating different pulse repetitionrates which may be selected for operation of a photoelectric controlunit in accordance with principles of the present invention.

FIG. 6 provides a graph illustrating how pseudo-random jitter may affectpulse timing in accordance with the principles of the present invention.

FIG. 7 provides a flow chart illustrating the function selection processassociated with the operator interface of the present invention.

FIG. 8 provides a flow chart illustrating the parameter setting processassociated with the operator interface of the present invention.

FIG. 9 provides a flow chart of the target acquisition process inaccordance with the principles of the present invention whereby jitteris used to vary interpulse intervals.

FIG. 10 provides a flow chart of the process for determining operatingmargin in accordance with the dual channel architecture of the presentinvention.

FIG. 11 provides a flow chart of the process for automaticallydetermining a gain setting for a photoelectric control unit inaccordance with the principles of the present invention.

FIG. 12 provides a flow chart of the process for determining theoperating margin under background conditions for use in the automaticgain setting routine of the present invention.

FIG. 13 provides a flow chart of the process for determining operatingmargin under target conditions for use in the automatic gain settingroutine of the present invention.

FIG. 14 provides a flow chart of the process for determining anoperational stability figure in accordance with the principles of thepresent invention.

FIG. 15 provides a three-dimensional surface mesh graph showingphotoelectric operating stability as a function of operation margin andbackground noise in accordance with fuzzy logic techniques.

DESCRIPTION OF THE PREFERRED EMBODIMENT

Referring now to FIG. 1, a photoelectric control unit 10 is shown havinga housing 12 for containing electrical and optical components and a pairof lenses 14 and 16 for directing optical output and collecting opticalinput. The photoelectric control unit 10 also includes an operatorinterface panel 20 having an informational display 22 and an inputkeypad 24.

Referring now to FIG. 2, the photoelectric control unit 10 can beconfigured for transmitting a lightbeam 30 of light pulses out from thelens 14 to a reflector 18 which directs a lightbeam of reflected lightpulses 32 to the lens 16 for synchronous detection of the return pulsesby the electronic components of the unit 10. The lightbeams 30 and 32define an optical path between the photoelectric control unit 10 and thereflector 18. When a target object 34 to be detected passes between thephotoelectric control unit 10 and the reflector 18 this optical path isbroken and the control unit senses the presence of the object 24 andgenerates an output signal indicative of the presence of the targetobject. It should, however, be understood that the photoelectric controlunit 10 can operate in a number of different configurations such as the"retroreflective" configuration described above or, for example, by"through beam" detection or by "diffuse proximity" sensing of lightreflected off of objects to be detected.

Referring now to FIG. 3, the operator interface panel 20 is shown asincluding a transreflective TNFE liquid crystal display 22 featuring athree-digit numerical display 40 and twelve display icons 41-52providing a graphical style interface for displaying controlinformation. The display 22 may also include an LED for providingbacklighting. A keypad 24 includes three separate input keys 24a, 24band 24c corresponding to up, down and enter actions respectively. Adisplay 26 includes three separate LEDs 26A, 26B and 26C which indicatewhen power is applied to the control unit 10, when the control unit 10is providing output and when a special photoelectric stability figurefor the control unit 10 (which will be described in greater detail withrespect to FIG. 14) is greater than a fixed threshold, respectively. Theicons 41-52 operate in conjunction with the keys 24a-24c to allow theoperator to readily select a number of different control optionsassociated with the photoelectric control unit 10. The icons 41-52 andtheir corresponding operational functions and menu categories aredescribed in the Icon Description Table below:

    __________________________________________________________________________    ICON DESCRIPTION TABLE                                                        ICON                                                                              CORRESPONDING FUNCTION                                                                              MENU CATEGORY                                       __________________________________________________________________________    LO  LIGHT OPERATE MODE    SET UP MODE - OUTPUT ON WHEN                                                  PHOTODETECTOR SEES LIGHT                            DO  DARK OPERATE MODE     SET UP MODE - OUTPUT OFF WHEN                                                 PHOTODETECTOR SEES LIGHT                            LRN LEARN - AUTOMATIC GAIN SETTING                                                                      AUTOMATIC PARAMETER - GAIN LEVEL                    HY  HYSTERESIS SETTING    SET UP PARAMETER - AMOUNT OF                                                  HYSTERESIS                                          SEN SENSITIVITY SETTING   SET UP PARAMETER - GAIN LEVEL                                                 (MANUAL)                                            ON  ON DELAY MODE (used with "DLY")                                                                     SET UP PARAMETER AND MODE - ON                                                OUTPUT TIMING DELAY                                 OFF OFF DELAY MODE (used with "DLY")                                                                    SET UP PARAMETER AND MODE - OFF                                               OUTPUT TIMING DELAY                                 ONS ONE SHOT TIMING MODE  SET UP PARAMETER AND MODE - ONE                                               SHOT OUTPUT TIMING                                  OPT OPTION MODE AND SETTINGS                                                                            SET UP PARAMETER - PULSE                                                      REPETITION RATE                                     MAR MARGIN DISPLAY        OPERATIONAL DISPLAY IDENTIFIER                      SCP SHORT CIRCUIT PROTECTION                                                                            DIAGNOSTIC INDICATOR, BLINKS TO                                               INDICATE EXCESSIVE OUTPUT                                                     CURRENT HAS TRIGGERED SCP                           DLY DELAY (ON OR OFF) MODE                                                                              SET UP MODE AND PARAMETER -                                                   OUTPUT TIMING FUNCTIONS                             __________________________________________________________________________

The icons 41-52 and their corresponding operations in providing visualmessages during both "run" and "program" modes are described in the IconOperation Table below:

    __________________________________________________________________________    ICON OPERATION TABLE                                                          __________________________________________________________________________    ICON                                                                              RUN MODE                 PROGRAM MODE                                     __________________________________________________________________________    LO  ALWAYS ACTIVE WHEN LIGHT OPERATE                                                                       ACTIVE IN MAIN MENU CYCLE                            MODE IS SELECTED         AFTER SEN WHEN DARK                                                           OPERATE MODE IS SELECTED                         __________________________________________________________________________    ICON                                                                              RUN FUNCTION             PROGRAM OPERATION                                __________________________________________________________________________    DO  ALWAYS ACTIVE WHEN IN DARK OPERATE                                                                     ACTIVE IN MAIN MENU CYCLE                            MODE IS SELECTED         AFTER SEN WHEN LIGHT                                                          OPERATE MODE IS SELECTED                         LRN ACTIVE AFTER LRN UNTIL SENSITIVITY                                                                     ACTIVE DURING                                        FUNCTION ACTIVATED       LEARN FUNCTION IN MAIN                                                        MENU CYCLE                                       HY  ACTIVE WHEN SMALL HYSTERESIS                                                                           ACTIVE DURING HYSTERESIS                             IS SELECTED              SETTING FUNCTION IN MAIN                                                      MENU CYCLE                                       SEN INACTIVE                 ACTIVE DURING SENSITIVITY                                                     SETTING FUNCTION IN MAIN                                                      MENU CYCLE                                       ON  ACTIVE IF NON-ZERO ON DELAY                                                                            ACTIVE DURING "DLY"                                  IS SELECTED              FUNCTION IN MAIN                                                              MENU CYCLE                                       OFF ACTIVE IF NON-ZERO OFF DELAY                                                                           ACTIVE DURING "DLY"                                  IS SELECTED              FUNCTION IN MAIN                                                              MENU CYCLE                                       ONS ACTIVE IS NON-ZERO ONS   ACTIVE DURING "DLY"                                  (ONE SHOT) DELAY IS SELECTED                                                                           FUNCTION IN MAIN MENU                                                         CYCLE                                            OPT INACTIVE                 ACTIVE DURING "OPT"                                                           FUNCTION IN MAIN MENU                                                         CYCLE                                            MAR ALWAYS ACTIVE            ACTIVE TO SIGNAL MENU EXIT                                                    (TO RUN MODE)                                    SCP FLASHES WHENEVER THE SHORT                                                                             FLASHES WHENEVER THE SHORT                           CIRCUIT PROTECTION FEATURE                                                                             CIRCUIT PROTECTION FEATURE                           ENGAGES                  ENGAGES                                          DLY ACTIVE IF ON, OFF, OR ONS                                                                              ACTIVE DURING ON, OFF                                DELAY ARE NON-ZERO       AND/OR ONS DELAY FUNCTIONS                       __________________________________________________________________________

Whenever the photoelectric control unit 10 is in the "program mode"after the enter key 24c is initially pressed the icons 41-52 correspondto two nested levels of menu items. The top level cycles between theSEN, LO/DO, LRN, HY, ON/DLY, OFF/DLY, ONS/DLY, OPT AND MAR icons 45,41/42, 43, 44, 46/52, 47/52, 48/52, 49 and 50, respectively, as thearrow keys 24a and 24b are pressed. When the enter key 24c is pressedthe function corresponding to the illuminated icon will be entered forselection of different types of mode or parameter settings. Pressing thearrow keys 24a and 24b advances the menu system to the next or previousmenu item leaving the setting or mode unchanged or at its default value.Alternatively, when specific functions are completed, the menu systemautomatically advances to the next indicated menu item unless otherwiseconfigured.

More specifically, when the sensitivity setting function correspondingto the SEN icon 45 is entered the numerical display 40 is activated forshowing a main gain level setting for the amplification systemassociated with the pulse detection electronics of the unit 10 on anarbitrary 1-250 scale. The arrow keys 24a and 24b may then be used tomanually set a new gain level for the pulse detection amplificationsystem. The gain value displayed on the display 40 is selected for useas the new gain level when the enter key 24c is again pressed.

When the light or dark operate selection function corresponding to theLO/DO icons 41 and 42 is entered the unit 10 toggles between oppositemodes of operation as the enter key 24c is pressed. If the photoelectriccontrol unit 10 is in the light operate mode and the enter key 24c ispressed, it toggles to the dark operate mode of operation and,conversely, if the photoelectric control unit 10 is in the dark operatemode of operation and the enter key 24c is pressed, it toggles to thelight operate mode of operation. Whenever the light operate mode isselected the DO icon 42 is displayed. Whenever the dark operate mode isselected the LO icon 41 is displayed.

When the learn function is entered corresponding to the LRN icon 43 thecontrol unit 10 "learns" both the "no light" condition and "light"condition and then automatically sets a gain setting associated with thepulse detection amplification system for optimum system sensitivity aswill be described in greater detail with respect to FIGS. 11A and 11B.It should be noted that the learn function is independent of the userselection of either light operate or dark operate modes. The "no light"condition must be presented to the photoelectric control unit 10 firstand therefore the sensor is initially presented with whatever isintended to produce the off state in the light operate mode and whateveris intended to produce the on state in the dark operate mode. At the endof the learn function the photoelectric control unit 10 reverts to therun mode with the numerical margin displayed and the MAR icon 50illuminated. The LRN icon 43 remains displayed until such time as thegain setting learned during the learn function is manually changedpursuant the sensitivity setting function.

When the hysteresis function corresponding to the HY icon 44 is enteredthe system toggles between a large hysteresis amount (e.g. 20%) and asmall hysteresis amount (e.g.5%)as the enter key 24c is pressed. Duringthe setting selection process the numerical display 40 shows either "hi"or "lo" symbols indicating the targeted selection. Whenever a smallamount of hysteresis is selected the HY icon 44 is illuminated toindicate that the system is operating at the small hysteresis setting.

When the output time delay settings function is entered corresponding tothe DLY icon 52 the display 20 indicates a currently selected or defaultdelay type (On Delay, Off Delay or One Shot) by illumination of theicons ON, OFF or ONS 46, 47 or 48 while the numerical display 40indicates a time delay setting. The arrow keys 24a and 24b may be usedto change the delay function which may then be selected by pressing theenter key 24c. The arrow keys 24a and 24b then control the numericaldisplay 40 for cycling through the different amounts of time delay. Aparticular delay time value may be selected by pressing the enter key24c. The process of delay time selection pursuant to the delay functioncontinues until all of the delay items have either been acted upon orpassed by.

When the option function corresponding to the OPT icon 49 is entered thenumerical display 40 indicates a currently selected or default lightpulse repetition rate. The arrow keys 24a and 24b may be used to controlthe numerical display 40 for cycling through different numerals (1, 2 or3) representing different repetition rates at which the unit 10 canoperate. A particular repetition rate may be selected by pressing theenter key 24c.

It should be noted that the photoelectric control unit 10 isoperationally active with respect to transmitting and detecting lightpulses and providing output except during the learn and optionfunctions. Furthermore, the photoelectric control unit 10 automaticallyreverts to the "run mode" and illuminates the MAR icon 50 after 6seconds of keypad inactivity except in the Learn function during which alonger period of inactivity such as 45 seconds inactivity is required torevert to the run mode. Whenever the unit 10 is in the run mode with theMAR icon 50 displayed a margin determination function corresponding tothe routine 200 of FIGS. 10A and 10B is active whereby the numericaldisplay 40 indicates the current operating margin on a 0.2-96 scalewhich allows the unit 10 to be mechanically aligned for optimumdetection results.

Referring now to FIG. 4, the electronic system 60 of the photoelectriccontrol unit 10 of the present invention includes a microprocessorsystem 62 for executing a software program which regulates the overalloperation of the unit 10. The system 60 also includes an LED 64 whichemits periodically timed light pulses which are collimated by the lens14 for output from the unit 10, The light pulses are produced inresponse to pulses of current supplied to the LED 64 from the currentdriver module 66 which operates under control of the microprocessorsystem 62, The light emitted by the diode 64 and returned to the unit 10may be focused by the lens 16 as it is received for pickup by the photodiode 70, The microprocessor system 62 regulates both the repetitionrate and amplitude level of the current and resulting light pulses inresponse to the operator selecting a particular repetition rate pursuantto the option function corresponding to the OPT icon 49 in accordancewith the Repetition Rate Table shown below:

    ______________________________________                                        REPETITION RATE TABLE                                                         REP    NOMINAL     NOMINAL       PEAK                                         RATE   FREQUENCY   RESPONSE TIME CURRENT                                      ______________________________________                                        1      1000 HERTZ  4 mS.          1.0 a                                       2      2500 HERTZ  1.6 mS        500 mA.                                      3      5000 HERTZ  0.8 mS        250 mA.                                      ______________________________________                                    

The repetition rate is controlled by designation of the nominal valuefor the Reprate counter used in the control routine 170 of FIG. 9 whichregulates the time intervals between pulse control signals supplied tothe module 66 on line 65, The gain of the driver module 66 is regulatedby control signals on lines 67 in order to control the level of pulsecurrent. The peak current must be controlled in coordination with pulserepetition rate to, among other things, avoid overloading the LED 64 asa result of increases in duty cycle. It should be noted that a naturaltrade off exists between system response time and detection range. Asthe repetition rate increases response time improves but range isreduced. The photoelectric control unit 10 allows the user theflexibility to select the most suitable repetition rate for hisparticular response time and range needs. FIG. 5 shows graphs 71 and 73of pulse trains 75 and 77 at repetition rates 1 and 2, respectively. Thepulses 75a-c and 77a-e have the same pulse duration, however, the pulses77a-e have one-half the amplitude and occur at two and one-half timesthe rate.

The photodiode 70 is connected to a fixed gain transimpedance amplifier72 which provides low impedance on its input and converts the currentsignal of the photodiode 70 to a voltage signal which is then suppliedto a main variable gain module 74. The main variable gain module 74includes a multiplying digital-to-analog converter 76 which providesvariable attenuation in response to control signals from themicroprocessor system 62 and a fixed gain amplifier 78 which provides afurther amount of signal gain. The output of the main variable gainmodule 74 is separately provided along a first channel A to a fixed gainamplifier 80 and along a second channel B to a margin variable gainmodule 84.

The fixed gain amplifier 80 provides output to a detection comparator 90which compares the amplitude of the output of the amplifier 80 with theamplitude of a reference level supplied from a reference generator 92under control of the microprocessor system 62. The detection comparator90 produces the main light pulse detection signal SDE_(T) which issupplied to the microprocessor system 62 as an indication of reflectedlight received by the unit 10 corresponding to light pulses emitted bythe LED 64.

The reference generator 92 is controlled by the microprocessor system 62to provide an output having four reference levels defining the small andlarge amounts of hysteresis which may be selected by the system operatorin accordance with the hysteresis setting function. The margin variablegain module 84 includes a multiplying digital-to-analog converter 86which provides variable attenuation in response to control signals fromthe microprocessor system 62 and a fixed gain amplifier 88. The marginvariable gain module 84 provides an output to the margin comparator 94which compares the amplitude of this signal with the amplitude of thereference signal supplied from the reference generator 92. The margincomparator 94 provides a margin signal S_(MAR) to the microprocessorsystem 62 which is useful in determining operating margin levels.

Channel A (including the amplifier 80 and detection comparator 90),Channel B (including the margin variable gain module 84 and the margincomparator 94) and the main variable gain module 74 provide anarchitecture which can be regulated by the microprocessor 62 undersoftware control for identifying operating margin levels over a broadrange of values and then automatically setting the gain of the system 74for optimum detection results. The operation of the system 60 inidentifying operating margin levels and automatically setting gainvalues will be further described with respect to FIGS. 11A, 11B, 12 and13. The system 60 also includes the electronic components associatedwith the display 22, the keypad 24 and the LED display 26. The display22 is driven by a LCD driver 96 for displaying output from amicroprocessor system 62 in accordance with the icons, numerals andassociated functions previously described. The keypad 24 provides inputto the microprocessor system 62 in coordination with the icons displayedby the LCD display and their associated functions. The LED display 26supplies visual outputs from the microprocessor system 62 indicatingbasic operational characteristics as previously described.

Referring now to FIG. 7, a routine 100 is shown for the highest level ofmenu control associated with the operation of the LCD display 22, theicons 41-52 and the keypad 24 whereby functions associated with theicons 41-52 may be entered for selecting operational modes and parametersettings. In the first step 102 the SEN icon 45 is displayed and itscorresponding function targeted for a possible entry. Thereafter, theprogram 100 includes steps 104, 106, 108, 110, 112, 114 and 116 wherebythe icons SEN 45, LO/DO 41 and 42, LRN 43, HY 45, DLY 52 and OPT 49 canbe sequentially displayed and their corresponding functions targeted forpossible entry in response to the up arrow key 24a being repetitivelypressed or (in reverse order) the down arrow key 24b being repetitivelypressed. As each icon is displayed the program queries whether the enterkey 24c has been pressed pursuant to step 118 and directs entry into thecorresponding function in accordance with step 120 whenever the enterkey 24c is pressed.

Referring now to FIG. 8, the program 130 includes steps 13.2, 134, 136and 138 whereby values shown on the numerical display 40 can beincremented and decremented by fixed amounts in response to the up arrowkey 24a being pressed in step 132 or the down arrow key 24b beingpressed in step 136. Simultaneously, the steps 140 and 142 of theprogram 130 provide that the displayed value of any variable can bedesignated for functional implementation in response to the enter key24c being pressed.

Referring now to FIG. 9, the pulse and detection control routine 170governing the operation of the photoelectric control unit 10 intransmitting light pulses, synchronously detecting response pulses andindicating when a target is acquired is shown. In accordance with thefirst step 172 a Reprate counter is set to a nominal value such as 500while a pulse counter is set to zero value. The program then proceeds tostep 174 in which the Reprate counter is decremented by a single numberto provide a new Reprate value. Thereafter, in step 176 the programqueries whether the Reprate counter is now equal to zero. If the Repratecounter is not equal to zero, the program jumps back to step 174 wherebythe counter is again decremented. If, on the other hand the Repratecounter is now equal to zero, the program then proceeds to step 178whereby it transmits a single light pulse. It should be noted thatcomputation time can be conserved if the Reprate Counter of steps 174and 176 is implemented in hardware by using a counter associated withthe microprocessor of the system 62. In step 180 the program .thenqueries whether a response pulse of reflected light has been(synchronously) received within the transmission period. If a returnlight pulse has been received, the program passes to step 182 in whichthe pulse counter is incremented by a single number to provide a newpulse count value. Steps 184,185 and 186 operate in conjunction witheach other-for directing different pulse count events to steps 194,195and 196, respectively, depending on the number of consecutive pulsesthat have been counted. If only one consecutive pulse has been receivedthe program is channelled to step 194. If two consecutive pulses havebeen received the program is channeled to step 195. If three consecutivepulses have been received the program is channeled to step 196. Steps194, 195 and 196 set the reprate counter to three different valueswhereby the "dwell" interval between light pulses is controlled to"jitter" so as to avoid interference between nearby photoelectriccontrol units and other on-frequency devices. In step 194 the Repratecounter is set to the nominal value plus a smaller psuedo-random code Avalue. In step 195 the reprate counter is set to the nominal value plusa smaller and different psuedo-random code B value. In step 196 thereprate counter is set to the nominal value plus the sum of thepsuedo-random code A and B values. Following steps 194, 195 and 196 theprogram jumps back to step 174 to execute the loop defined by steps 174and 176 which determines the duration of the time interval between lightpulses. Since the Reprate counter is set to different values in steps194, 195 and 196, the loop comprised of steps 174 and 176 takescorrespondingly-different amounts of time to be executed which resultsin light pulses being transmitted at slightly different and non-standardintervals at step 178. Whenever a fourth consecutive light pulse isreceived the program passes through steps 184, 185 and 186 to step 188whereby the output is turned on and the detection threshold is loweredin accordance with the hysteresis value setting. Thereafter, in step 190the reprate counter is again set to its nominal value while the pulsecounter is set to a value of three to insure that step 188 is reachedwhenever further consecutive pulses are received. Returning now to step180, if a return light pulse is not received, the program is directed tostep 160 in which the reprate counter is again set to its nominal valuewhile the pulse counter is set to zero value. Thereafter, in step 162the output is turned off (if it had been previously turned on) and thedetection threshold is reset (if it had been previously lowered) inaccordance with the hysteresis setting. After step 162 the program jumpsback to step 174 for completion of another standard "dwell" interval andthe transmission of another light pulse in accordance with step 178. Theroutine 170 controls the output of the photoelectric control unit 10 sothat targets can only be acquired after repetitive and consecutive lightpulse responses have been received. Furthermore, the routine 170 shiftsthe intervals between light pulses in accordance with random codes whichcan be set to different values for different control units at thefactory in order to provide different jitter factors which help insurethat nearby photoelectric control units do not interfere with eachother. FIG. 6 shows a graph 161 of a pulse train 163 during successfultarget acquisition over four consecutive pulses 165a-d. Pulse 165b istime delayed by a random code A jitter factor 167a. Pulse 165c is timedelayed by a random code B jitter factor 167b. Pulse 165d is timedelayed by a random code A+B jitter factor 167c. The time delay factors167a-c provide a type of aperiodic timing which when combined with thesynchronous detection technique used in the unit 10 avoids interferencefrom other nearby photoelectric control units transmitting pulses atsimilar repetition rates and other sources of on frequency noise.

Referring now to FIG. 10, the margin routine 200 is operative fordetecting the operating margin of the photoelectric control unit 10 bymanipulating the gains of the variable gain modules 74 and 84 andfollowing the output of the margin comparator 94. In step 202 theprogram queries whether the object at which the photoelectric controlunit 10 is targeted is being detected as indicated by the output S_(DET)of the detection comparator 90 in order to make a branching decision.

If the target is not detected, the gain of the margin variable gainmodule 84 (the "gain margin") is set to three in accordance with step204 by adjusting the attenuation of the multiplying digital-to-analogconverter 86. The program then proceeds to step 206 in which the gain ofthe module 84 is incremented by an amount that varies in accordance withgain level to provide a linear scale for margins of less than 1 as shownin the Gain Margin Table below:

    ______________________________________                                        GAIN MARGIN TABLE                                                             OFF Margin-Gain     ON Margin-Gain                                            ______________________________________                                        .2-15x              1.0-3.0x                                                  .3-10x              1.1-2.727x                                                .4-7.5x             1.2-2.50x                                                 .5-6.0x             1.3-2.308x                                                .6-5.0x             1.4-2.143x                                                 .7-4.286x          1.5-2.0x                                                   .8-3.75x           1.6-1.875x                                                1.0-3.0x            1.7-1.765x                                                                    1.8-1.667x                                                                    1.9-1.579x                                                                    2.0-1.50x                                                                     2.5-1.2x                                                                      3.0-1.0x                                                                      3.5-0.857x                                                                    4.0-0.75x                                                                     5.0-0.60x                                                                     6.0-0.50x                                                 ______________________________________                                    

In step 208 the program queries whether the margin comparator 94 is onas indicated by its output signal S_(MAR). If the margin comparator 94is on, the program is directed to step 210 in which it uses the currentvalue-of the gain margin as an indice to look up a value for theoperating margin. The program can then terminate in accordance withblock 212.

If, on the other hand the margin comparator 94 is not on, the programthen queries whether the gain margin is at its maximum level inaccordance with step 214 in order to make a branching decision. If thegain of the margin module 84 is not at maximum level, the program jumpsback to step 206. If, on the other hand, the gain of the margin module84 is at its maximum level, the program sets the operating margin valueto zero in step 216 and terminates in accordance with block 218. Thesteps 206, 208 and 214 establish a loop by means of which the gainmargin is increased step by step until the margin comparator 94 isturned on. The gain level for the margin variable gain module 84required to turn the margin comparator 94 on provides a reference fordetermining the operating margin of the photoelectric control unit 10.

Returning now to step 202, if a target object is detected, the programproceeds to steps 220 and 222 in which a "throttle factor" counter isset to zero and the gain margin is set to three by adjusting theattenuation of the multiplying digital-to-analog converter 86. Thethrottle factor corresponds to the gain level of the main variable gainmodule 74 (the "main gain") which is adjustable in accordance with step238 at five levels which are related as shown in Throttle Margin Tablebelow:

    ______________________________________                                        THROTTLE MARGIN TABLE                                                         THROTTLE FACTOR      MAIN GAIN                                                ______________________________________                                        0                    user setting                                             1                    user setting/2                                           2                    user setting/4                                           3                    user setting/8                                           4                    user setting/16                                          ______________________________________                                    

Thereafter, the program proceeds to step 224 in which the gain of themodule 84 is decremented by an amount that varies in accordance withgain level to provide a nonlinear scale as shown in the Gain MarginTable. In step 226 the program queries whether the margin comparator 94is off as indicated by its output signal S_(MAR). If the margincomparator 94 is off, the program is directed to step 228 in which ituses the current value of the gain margin and the current value of thethrottle factor to look up a value for the operating margin. The programthen terminates in accordance with block 230.

If, on the other hand the margin comparator 94 is on, the program thenqueries whether the gain margin is equal to one-half in order to preventthe gain from being reduced to the point where saturation conditions mayaffect the amplifiers in the system 60. If the gain margin is not equalto one-half, the program jumps back to step 224 whereby the gain marginis again decremented. If, on the other hand the gain margin is equal toone-half, the program passes to step 234 in which it increments thethrottle factor corresponding to different levels of main gain.Thereafter, in step 236 the program queries whether the throttle factoris now equal to five in order to make a branching decision. If thethrottle factor is not equal to five, the program proceeds to step 238in which the gain of the main variable gain module 74 is reduced toone-half its current level by adjusting the attenuation of themultiplying digital-to-analog converter 76. The program then passes backto step 222 and subsequent steps whereby the gain level of the marginvariable module 84 is manipulated in three steps corresponding to thelast three ON margin steps of the Gain Margin Table in an attempt toagain get the margin comparator 94 to turn off. However, if in step 236the throttle factor is determined to be equal to five, the program setsthe value of the operating margin to its maximum level in step 240 andterminates in accordance with step 242.

Steps 234, 236 and 238 provide a first loop for throttling down the maingain of the system 60 through five levels to avoid saturation effectswhich may be affecting the system amplifiers while steps 222, 224, 226and 232 provide a second loop for reducing the gain margin step by stepuntil the margin comparator turns off. The levels of the main gain (orthe throttle factor) and the gain margin can then be used as indices forlooking up a value for the operating margin of the photoelectric controlunit 10.

Referring now to FIG. 11, the automatic gain setting routine 300provides the learn function corresponding to the LRN icon 43 and enablesthe photoelectric control unit 10 to view background conditions, viewthe target conditions and determine an optimum main gain setting for thesystem 60 to insure reliable target detection. In the first step 302,the LO legend is displayed. Thereafter, in step 304 the program querieswhether the enter key 24c has been pressed as an indication that thecontrol unit 10 is properly configured for executing the learnbackground routine 306. The routine 306 is shown in FIG. 12 and providesfor manipulation of the main gain of the control unit 10 to achieve anoperating margin of less than 0.3 under background conditions. Theprogram then passes to step 308 in which the HI legend is displayed.Thereafter, in step 310 the program queries whether the enter key 24chas been pressed as an indication that the photoelectric control unit 10is properly configured for execution of the learn target routine 312.The routine 312 is shown in FIG. 13 and provides for manipulation of themain gain of the system 60 to provide the optimum setting under targetconditions. The program proceeds to step 314 in which the operatingmargin is displayed on the numerical display 40 and the margin icon 38is illuminated in accordance with normal run mode operating conditionsas the routine 300 is terminated in accordance with block 316.

Referring now to FIG. 12, the learn background routine 306 begins withthe photoelectric unit arranged for viewing the background as indicatedby step 320. In accordance with step 322 the main gain (of the variablegain module 74) is then set to one-half of its maximum level byadjusting the attenuation of the converter 76. The program then passesto step 324 in which it computes the operating margin pursuant toroutine 200 and queries whether it is greater than 0.3 in order to makea branching decision. If the operating margin is greater than 0.3, theprogram is directed to step 323 in which the main gain is decremented byone (counter) step. The program then proceeds to step 325 in which itcomputes a new operating margin pursuant to routine 200 and querieswhether the operating margin is now less than 0.3 in order to makeanother branching decision. If the operating margin is not less than0.3, the program is directed to step 328. In step 328 the programqueries whether the main gain is still greater than a default minimumnecessary for proper operation of the photoelectric control unit 10. Ifthe main gain is greater than the default minimum, the program jumpsback to step 323 but otherwise the routine 306 terminates at block 330.Returning to step 325, if the operating margin is less than 0.3, theprogram exits the routine 306 at block 332 and passes to step 308 of theroutine 300. Returning now to step 324, if the operating margin is notgreater than 0.3, the program is directed to step 321 in which the maingain is set to its maximum level by adjusting the attenuation of theconverter 76. The program then passes to step 327 in which it computes anew operating margin pursuant to routine 200 and queries whether it isless than 0.3. in order to make yet another branching decision. If theoperating margin is not less than 0.3 the program is directed to step326 in which the main gain is decremented by one (counter) step andthereafter jumps back to step 327. If, on the other hand, the operatingmargin is less than 0.3, the program exits the routine 306 at block 332and passes to step 308 of the routine 300. The learn background routine306 lowers the main gain down from its maximum level on a step by stepbasis until the operating margin is less than 0.3 under backgroundconditions.

Referring now to FIG. 13, the learn target routine 312 begins with thephotoelectric unit arranged for viewing the target as indicated by step340. In step 342 the program computes the operating margin and querieswhether the operating margin is greater than 2.0. If the operatingmargin is greater than 2.0, conditions are satisfactory for detectionoperations and the program is directed to exit the routine 312 at block344 and reenter the routine 300 at step 314. If the margin is less than2.0 the program proceeds to step 346 in which it queries whether theoperating margin is less than 0.6. If the operating margin is less than0.6, the program is directed to block 348 for termination of theroutines 300 since a sufficient operating margin cannot be obtained forsatisfactory control operations. If, on the other hand the operatingmargin is not less than 0.6, the program then passes to step 350 inwhich it queries whether the operating margin is less than 2.0 butgreater than 0.6. If the operating margin is not between 0.6 and 2.0,the program is again directed to the exit block 348 since an error hasoccurred in the calculations associated with the routines 300, 306 and312. If, on the other hand the operating margin is between 0.6 and 2.0,the program passes to step 352 in which the main gain is increased byone step. Thereafter, in step 354 the programs queries whether theoperating margin is equal to 2.0. If the operating margin is not equalto 2.0, the program is directed to step 356 in which it queries whetherthe main gain is at its maximum level. If the main gain is not at itsmaximum level, the program jumps back to step 352 whereby the gain isincreased by yet another step. If, on the other hand, the main gain hasnow reached its maximum level, the program yet again passes to the block348 for termination of the automatic gain setting routine 300. Returningto step 354, if the operating margin is equal to 2.0, the programproceeds to step 360 in which it calculates an ideal gain setting forthese conditions in accordance with equation 1 below:

Ideal Sensitivity=(2* gain1* gain3)/((2* gain3)+(off margin * gain1))

Where:

Gain1=gain needed to get the on margin up to 2.0 during the "learntarget" routine

Off margin=minimum off margin measured during the "learn background"routine

Gain3=gain at which the 0.3 off margin was produced during the "learnbackground" routine

and adjusts the main gain value by proportionately reducing the digitalcontrol input to the converter 76.

The program then exits the routine 312 at block 362 and returns toroutine 300 at step 314. The routine 312 provides for the main gain tobe optimized in view of target conditions and especially for the maingain to be set at an optimum value for difficult operating conditionswhen the light/dark differential is small (e.g. the operating margin isbetween 0.6 and 2.0).

Referring now to FIG. 14, the present invention also provides anindication of photoelectric operational stability based on fuzzy logictechniques through the LED display 26 pursuant to the operation of theroutine 400 which runs in the background to provide information aboutoperating conditions affecting the photoelectric control unit 10. Instep 402 the program executes the margin routine 200 for determiningoperating margin. The program then proceeds to step 404 and detects thelevel of optical or electrical noise by counting the number of noisepulses tripping the detection comparator 90 during interpulse periods(i.e. during intervals when light pulse signals are not beingtransmitted and return pulses are not being received). The number ofnoise pulses which activate the comparator 90 during interpulse periodsprovides a measure of the noise in the environment which is readilyobtained by the electronic system 60 without interference with its otheroperations. The program uses the operating margin and noise level valuesto reference an operational stability figure using a lookup table inaccordance with step 406. In step 408 the program compares the stabilityfigure from the look-up table with preset threshold (such as 2.0) andprovides for the LED 26C to be illuminated if the stability figure isgreater than the threshold.

The stability figure lookup table is generated in accordance withwell-known fuzzy logic techniques given the membership functions andrules which are described hereinafter. Membership functions foroperating margin, noise and stability are defined in accordance with theFuzzy Logic Function Table below:

    ______________________________________                                        FUZZY LOGIC FUNCTION TABLE                                                    FUNCTION   0 Start 1.0 Up    1.0 Down                                                                              0 Stop                                   ______________________________________                                        margin-lowoff                                                                            -1.0    -1.0      -0.84   -0.76                                    margin-medoff                                                                            -0.84   -0.76     -0.68   -0.68                                    margin-invalid                                                                           -0.68   -0.68     -0.52   -0.52                                    margin-lowon                                                                             -0.52   -0.52     -0.40   -0.12                                    margin-medon                                                                             -0.40   0.0       0.0     0.50                                     margin-medhion                                                                           -0.20   0.30      0.30    0.68                                     margin-hion                                                                              0.52    0.68      1.0     1.0                                      noise-low  -1.0    -1.0      -0.90   -0.30                                    noise-med  -1.0    0.0       0.0     0.70                                     noise-hi   -0.20   0.40      1.0     1.0                                      stability-low                                                                            -1.0    -1.0      -0.50   0.0                                      stability-med                                                                            -0.50   0.0       0.0     0.50                                     stability-medhi                                                                          0.0     0.40      0.40    0.70                                     stability-hi                                                                             0.30    0.70      1.0     1.0                                      ______________________________________                                         Seven membership functions are defined for operating margin while three     membership functions are defined for noise and four membership functions     are defined for stability. The figures in the fuzzy logic table are     normalized from truncated operating ranges of from 0 to 5 in the case of     operating margin, from 0 to 15 in the case of noise and from 15 to 109 in     the case of stability. The four normalized figures describe a trapezoid     (or triangle) which defines the degree of membership of each function. The     first column of figures (under 0 start) represents the point at which the     membership functions first begin to increase in value from 0 (0% certainty     of membership). The second column of figures (under 1.0 up) represent the     point at which the membership functions first attain a value of 1.0 after     linearly ascending from 0. The third column of figures (under 1.0 down)     represents the point at which the membership functions first begin to     decrease in value from 1.0. The fourth column of figures (under 0 stop)     represents the point at which the membership functions reach 0 value after     linearly descending from 1.0. The values of the membership functions are     combined in accordance with conventional center of gravity techniques or     equivalent in accordance with the rules in the Fuzzy Logic Rule Table     below:

    ______________________________________                                        FUZZY LOGIC RULE TABLE                                                        Margin        Noise         Stability                                         ______________________________________                                        invalid       low, med, hi  low                                               lowoff        low           hi                                                lowoff        med           medhi                                             lowoff        hi            low                                               medoff        low           hi                                                medoff        med           med                                               medoff        hi            low                                               lowon         low           med                                               lowon         med, hi       low                                               medon         low           medhi                                             medon         med           med                                               medon         hi            low                                               medhion       low           hi                                                medhion       med           medhi                                             medhion       hi            med                                               hion          low, med      hi                                                hion          hi            medhi                                             ______________________________________                                    

The membership functions and rules determine the entries for the lookuptable as illustrated in the three-dimensional graph shown in FIG. 15.The lookup table relates certain discrete values of operating margin andnoise to stability figures in accordance with the degree of accuracydesired. These stability figures can then be used in providing visualdisplays or, alternatively, can be output as an analog signal from thephotoelectric control unit so that performance of the unit 10 could bemonitored at a remote location.

While particular embodiments of the present invention have been shownand described, it should be clear that changes and modifications may bemade to such embodiments without departing from the true scope andspirit of the invention. It is intended that the appended claims coverall such changes and modifications.

We claim:
 1. A process for detecting the passage of a target objectusing a photoelectric control unit, comprising the steps of:transmittinga series of periodic light pulses across the projected path of saidtarget said series including a first pulse subject to a firstpseudo-random jitter factor, a second pulse subject to a secondpseudo-random litter factor and a third pulse subject to a thirdpseudo-random jitter factor which is equal tot he sum of said first andsecond pseudo-random jitter factors; synchronously detecting returnedlight pulses corresponding to said transmitted light pulses; generatinga pulse count value corresponding to numbers of consecutive returnedlight pulses which are synchronously detected including said pulsessubject to said pseudo-random jitter factors; and signaling the presenceof said target object when said pulse count value reaches a presetthreshold.